<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			function Student(name) {
				this.name = name;
			}
			//给Student新增一个方法
			Student.prototype.Hello = function () {
				alert("Hello")
			};
			//ES6之后
//			class Student{
//				
//				constructor(name1){
//					this.name = name;
//				}
//				hello(){
//					alert('甘雨')
//				}
//			}
			class xiaoStudent extends Student{
				constructor(name,grade){
					 super(name);
					 this.grade = grade;
				}
				myGrade(){
					alert('我是一名小学生');
				}
			}
			var xiaoming = new Student("xiaoming");
			var xiaohong = new xiaoStudent("xiaohong",1);
			//
			
		</script>
	</body>
</html>
